//
//  FixOneCell.m
//  ZhiHuiLiJiang
//
//  Created by work on 2018/11/14.
//  Copyright © 2018年 王雅鹏. All rights reserved.
//设置Cell

#import "FixOneCell.h"
@interface FixOneCell()
/**下划线*/
@property(nonatomic,weak)UIView *lineView;
/**图标*/
@property (nonatomic, weak)UIImageView *iconImgView;
/**标题*/
@property (nonatomic, weak)UILabel *sportTitleLab;
/**缓存*/
@property(nonatomic,weak)UILabel *cacheLab;


@end
@implementation FixOneCell
#pragma mark- init初始化
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self addCellSubview];
    }
    return self;
}
- (void)addCellSubview{
    //标题
    _sportTitleLab = [BYVS createLabText:@"" font:BYPTFont34 labColor:BYRGBA(39,39,39,1.0) addSubView:self.contentView];
    //缓存
    _cacheLab = [BYVS createLabText:@"" font:BYPTFont28 labColor:BYRGBA(39,39,39,1.0) addSubView:self.contentView];
    _cacheLab.textAlignment = NSTextAlignmentRight;
    //箭头
    _arrowIcon = [[UIImageView alloc]init];
    _arrowIcon.image = [UIImage imageNamed:@"arrow_right"];
    [self.contentView addSubview:_arrowIcon];
    //下划线
    _lineView = [BYVS createViewBGColor:BYColor6 addSubView:self.contentView];
    
    [self setSubViewFrame];
}
- (void)setSubViewFrame{
    BY_kWeakSelf(ws);
    [_sportTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {//标题
        make.centerY.equalTo(ws.contentView.mas_centerY);
        make.left.equalTo(ws.contentView.mas_left).offset(BY_Width(20));
        make.width.offset(BY_ScreenWidth/2.0);
    }];
    [_cacheLab mas_makeConstraints:^(MASConstraintMaker *make) {//缓存
        make.right.equalTo(ws.contentView.mas_right).offset(BY_Width(-20));
        make.centerY.equalTo(ws.contentView.mas_centerY);
        make.left.equalTo(ws.sportTitleLab.mas_right).offset(BY_Width(10));
    }];
    [_arrowIcon mas_makeConstraints:^(MASConstraintMaker *make) {//箭头
        make.centerY.equalTo(ws.contentView.mas_centerY);
        make.right.equalTo(ws.contentView.mas_right).offset(BY_Width(-20));
    }];
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {//下划线
        make.bottom.left.width.equalTo(ws.contentView);
        make.height.offset(BY_Height(1));
    }];
}

#pragma mark- 数据处理
- (void)setTitleStr:(NSString *)titleStr{//标题的值
    _titleStr = titleStr;
    _sportTitleLab.text = _titleStr;
}
- (void)setCacheStr:(NSString *)cacheStr{//缓存的值
    _cacheStr = cacheStr;
    _cacheLab.text = _cacheStr;
}


@end
